package com.yt.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Classname ApplicationContextConfig
 * @Description
 * @Date 2021/10/18 14:47
 * @Create by 杨涛
 */
@Configuration
//@EnableAutoConfiguration(exclude= DataSourceAutoConfiguration.class)
public class ApplicationContextConfig {

    //    引入RestTemplate(类似httpclient)
    @Bean
    //使用服务名称后需要添加负载均衡
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
